package org.zoomdev.zoom.web.parameter.parser.impl;

import org.zoomdev.zoom.web.action.ActionContext;
import org.zoomdev.zoom.web.parameter.ParameterAdapter;

import java.lang.reflect.Type;

public final class ProxyParameterAdapter implements ParameterAdapter {

    private final ParameterAdapter adapter;

    public ProxyParameterAdapter(ParameterAdapter adapter) {
        this.adapter = adapter;
    }

    @Override
    public Object get(ActionContext context, String name, Type type) {
        Object value = adapter.get(context, name, type);
        return proxy(value, name, type);
    }

    protected Object proxy(Object value, String name, Type type) {
        return value;
    }
}
